package com.yx.robot.bean.robot;


import com.yx.robot.sdk.req.CleanParam;
import com.iot.common.utils.LogUtils;

public class RobotStatus {
    /**
     * 清扫模式
     * <p>
     * 自动清扫
     * 全局清扫
     * 划区清扫
     * 选区清扫
     * 定点清扫
     * 延边清扫
     * 遥控清扫
     * 回冲模式
     * 拖地模式
     * 自动分区模式
     * 快速模式 TODO
     */
    public static final int MODE_AUTO_CLEAN = 1;
    public static final int MODE_GLOBAL_CLEAN = 2;
    public static final int MODE_CUSTOM_CLEAN = 3;//区域
    public static final int MODE_ROOM_CLEAN = 4;//选区
    public static final int MODE_SPOT_CLEAN = 5;//定点
    public static final int MODE_EDGE_CLEAN = 6;
    public static final int MODE_CONTROL = 7;//遥控
    public static final int MODE_RECHARGE = 8;
    public static final int MODE_MOP = 9;
    public static final int MODE_QUICK = 10;


    /**
     * 机器清扫状态
     * 0.待机
     * 1.清扫中
     * 2.暂停
     * 3.充电
     * 4.错误
     * 5.休眠
     * 6.自动分区扫
     * 7.延边清扫
     * 8.局部清扫/定点清扫
     * 9.集尘状态
     * 10.回充中
     * 11.选区清扫
     * 12.区域清扫
     * 13.风干拖布中
     * 14.清洗拖布中
     * 15.充电完成
     * 16.局部清扫
     * 17.返回基站中
     */
    public static final int STATE_STANDBY = 0;
    public static final int STATE_WORKING = 1;
    public static final int STATE_PAUSE = 2;
    public static final int STATE_CHARGING = 3;
    public static final int STATE_ERROR = 4;
    public static final int STATE_DORMANT = 5;
    public static final int STATE_DUST_COLLECTION = 9;//集尘状态
    public static final int STATE_DUST_COLLECTION_PUBLIC = 10;//集尘状态(注：因RS11(x1)机型的集尘没有指令相关，只显示集尘状态故不能使用 STATE_DUST_COLLECTION)
    public static final int STATE_DRYING_MOP = 13;//风干拖布中
    public static final int STATE_CLEANING_MOP = 14;//清洗拖布中
    public static final int STATE_GOTO_BS = 17;//返回基站中

    //清扫过程中的子状态 暂时只有公版有
    public static final int SUBSTATE_NONE = 100;//无
    public static final int SUBSTATE_WORKING_GOTO_POS = 118;//前往目标点中
    public static final int SUBSTATE_WORKING_POS_ARRIVED = 119;//目标点已到达
    public static final int SUBSTATE_WORKING_POS_UNARRIVE = 120;//目标点不可达
    public static final int SUBSTATE_WORKING_REPOSITING = 122;//重定位中
    public static final int SUBSTATE_WORKING_CREATINGMAP = 123;//建图中

    /**
     * 工作状态
     */
    private int state = STATE_STANDBY;
    private int subState=SUBSTATE_NONE;
    /**
     * 工作模式
     */
    private int workMode = MODE_AUTO_CLEAN;
    /**
     * 当前电量
     */
    private int battery;
    /**
     * 当前水量
     */
    private int water;

    private String error;
    private String message;


    private CleanParam cleanParam;  //当前清扫的参数

    public static int DUST_NORMAL = 0;
    public static int DUST_CHECK = 1;
    public static int DUST_NONE_PACKAGE = 2;
    public static int DUST_FULL = 3;
    public static int DUST_OPERATE_TOO_FAST = 4;
    public static int DUST_FINISH = 5;

    private int collectDustState = DUST_NORMAL;

    public int getWorkState() {
        return state;
    }

    public void setWorkState(int state) {
        LogUtils.i("setWorkState : " + state);
        this.state = state;
    }

    public int getSubState() {
        return subState;
    }

    public void setSubState(int subState) {
        this.subState = subState;
    }

    public int getWorkMode() {
        return workMode;
    }

    public void setWorkMode(int workMode) {
        this.workMode = workMode;
    }

    public int getBattery() {
        return battery;
    }

    public void setBattery(int battery) {
        this.battery = battery;
    }

    public int getWater() {
        return water;
    }

    public void setWater(int water) {
        this.water = water;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public int getCollectDustState() {
        return collectDustState;
    }

    public void setCollectDustState(int collectDustState) {
        this.collectDustState = collectDustState;
    }

    public CleanParam getCleanParam() {
        return cleanParam;
    }

    public void setCleanParam(CleanParam cleanParam) {
        this.cleanParam = cleanParam;
    }
}


